package com.zb.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zb.entity.ZjSystemServiceLogAnnex;
import com.zb.mapper.ZjSystemServiceLogAnnexMapper;
import com.zb.service.ZjSystemServiceLogAnnexService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 系统服务商日志附件表 服务实现类
 * </p>
 *
 * @author WEN
 * @since 2023-08-07
 */
@Service
public class ZjSystemServiceLogAnnexServiceImpl extends ServiceImpl<ZjSystemServiceLogAnnexMapper, ZjSystemServiceLogAnnex> implements ZjSystemServiceLogAnnexService {

    // 新增系统服务商日志附件
    @Override
    public void save(Long id, Long custAccId, List<String> annexs) {
        if (null == annexs || annexs.isEmpty()) {
            return;
        }
        List<ZjSystemServiceLogAnnex> logAnnexes = new ArrayList<>();
        ZjSystemServiceLogAnnex an = null;
        for (String s : annexs) {
            an = new ZjSystemServiceLogAnnex();
            an.setId(id);
            an.setCustAccId(custAccId);
            an.setImage(s);
            logAnnexes.add(an);
        }
        this.saveBatch(logAnnexes);
    }
}
